<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript">
  $(function(){
	 $("#files").change(function(){
		// alert($(this).val());
		 var filename = $(this).val();
		
		 var rname=filename.substr(filename.lastIndexOf("\\")+1);
		  rname = rname.split(".")[0];
		 $("#dataName").val(rname);
	 }) ;
  });
</script>
<c:if test="${success==true }">
   <div class="ts" style='height:40px;padding:1px;width:90%;'>
	  <div style='margin-top:15px;'><p align="center" style='color:'>添加成功</p></div>
	</div>
</c:if>
<c:if test="${success==false }">
   <div class="ts" style='height:40px;padding:1px;width:90%;'>
	  <div style='margin-top:15px;'><p align="center" style='color:'>添加失败</p></div>
	</div>
</c:if>

<div>
	<form action="<%=basePath %>backend/uploadfile" class='form-horizontal' method="post" enctype="multipart/form-data">
	
	   
           <div class='row' style='margin-top:10px;'>
             <div class="span6 control-group">
                 <label class="control-label" for="files">资&nbsp;料&nbsp;上&nbsp;传:</label>
                   <div class="controls">
                  <input class="" style='' type="file" name="files" id="files" placeholder="资料上传"/>
                   </div>
               </div>
           </div>
           <div class="row" style='margin-top:10px;'>
               <div class="span6 control-group">
                 <label class="control-label" >所&nbsp;属&nbsp;类&nbsp;型:</label>
                  <div class="controls">
                  <select class="form-control" style='height:100px;' id='ddtype' name='ddtype'>
                   
                  <c:forEach items="${ ddTypes}" var="major">
                     <option value="${major.ddtypeId }">${major.ddtypeName }</option>
                  </c:forEach>
                  </select>
                  </div>
               </div>
               </div>
           <div class="row" style='margin-top:30px;margin-left:'>
              
               <div class="span6 control-group">
                 <label class="control-label" >资&nbsp;料&nbsp;名&nbsp;称:</label>
                  <div class="controls">
                   
                  <input class="form-control " name="dataName" id="dataName" placeholder="资料名称" type="text" />
              </div>
               </div>
                 
               <!-- Optional: clear the XS cols if their content doesn't match in height -->
               <div class="clearfix visible-xs"></div>
              
           </div>
		
		<input type="submit" class='btn btn-info' style='margin-left:400px;margin-top:30px;'value="上传">
	</form>
</div>